package com.teamview.teamJunit;

import com.teamview.domain.Employee;
import com.teamview.service.NameListService;
import com.teamview.service.TeamException;
import org.junit.Test;

/**
 * @author Lenl
 * @create 2021-06-01 23:40
 * 对NameListService的测试
 */
public class NameListServiceTest {
    @Test
    public void testGetAllEmployees(){
        NameListService service=new NameListService();
        Employee[] employees= service.getAllEmployees();
        for (int i=0;i<employees.length;i++){
            System.out.println(employees[i]);
        }
    }
    @Test
    public void testGetEmployee(){
        NameListService service=new NameListService();
        int id=13;
        try{
            Employee employee=service.getEmployee(id);
            System.out.println(employee.toString());
        }catch (TeamException e){
            System.out.println(e.getMessage());
        }
    }
}
